1. Field of the Invention
This invention relates generally to the Java program compiling, and more particularly to systems and methods for a Java Macro preprocessor.
2. Description of the Related Art
Programming languages today are commonly written in plain text and later transformed into a machine readable computer program using a compiler. Often, the plain text program includes code portions that should only be compiled when certain conditions are met. Similarly, plain text programs often include constants that are confusing for program maintenance unless meaningful names are attached to them. To allow developers to handle these situations, many computer programming languages, such as C++, have software, referred to as preprocessors, that performs preliminary processing on the input plain text program file prior to compiling the plain text program.
FIG. 1 is a block diagram showing a prior art preprocessor data flow 100. The preprocessor data flow 100 shows a program text file 102, a preprocessor and compiler system 104, and a resulting executable program file 106. The program text file 102 generally comprises computer programming code and meta code for use with the Java preprocessor. Meta code is lines of text in a source file which start with a particular symbol, such as the ‘#’ symbol. Such lines are treated as directives by the preprocessor.
In operation, the program text file 102 is provided to the preprocessor and compiler system 104, which preprocesses and compiles the program text file 102. The preprocessor and compiler system 104 then generates the executable program file 106, which can then be executed by a computer. The preprocessor processes the program text file 102 based on the meta code present in the program text file 102.
The meta code provides the directives that the preprocessor uses to alter the program text file 102 in preparation for compiling. The meta code typically includes directives to substitute constants for various strings, and directives for conditional compiling. Conditional compiling often directs the preprocessor to select a first section of code for later compiling if a particular condition is met, or a second section of code if the condition is not met.
Unfortunately, since preprocessor directives were prohibited by the Java language specification, preprocessors are currently unavailable for the Java computer programming language. Java, originally developed by Sun Microsystems, is an object-oriented, multi-threaded, portable, platform-independent, secure programming environment used to develop, test and maintain software programs. Java programs have found extensive use on the World Wide Web, which is the Internet's multimedia information retrieval system. These programs include full-featured interactive, standalone applications, as well as smaller programs, known as applets, that run in a Java-enabled Web browser or applet viewer. Unfortunately, the lack of preprocessing ability in the Java language greatly reduces the power and efficiency available when using the Java programming language.
In view of the foregoing, there is a need for systems and methods that provide preprocessing in a Java environment. The systems should allow meta code to be included in Java plain text program files, and should further provide great flexibility in the directives that can be used with the Java preprocessor.